/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.sadhar.sipp.posbiaya;

import java.util.Map;
import org.sadhar.errhandler.ClassAntiNull;
import org.sadhar.sia.framework.ClassApplicationModule;
import org.zkoss.zul.Label;
import org.zkoss.zul.Listbox;
import org.zkoss.zul.Textbox;
import org.zkoss.zul.Window;

/**
 *
 * @author bloodrunk
 */
public class PosBiayaPopupOnPerekamanAnggaranBiayaUnitNonRapatKerjaWnd extends ClassApplicationModule {

    private Listbox lstboxPosBiaya;

    public PosBiayaPopupOnPerekamanAnggaranBiayaUnitNonRapatKerjaWnd() {
    }

    public void onCreate() throws Exception {
        lstboxPosBiaya = (Listbox) getFellow("lstboxPosBiaya");

    }

    public void lstboxPosBiayaOnSelect() throws Exception {
        Window w = (Window) this.getParent();

        Textbox txtboxIdPosBiaya = (Textbox) w.getFellow("txtboxIdPosBiaya");
        Label lblPosBiaya = (Label) w.getFellow("lblPosBiaya");
        Textbox txtboxPosBiayaSearchP = (Textbox) w.getFellow("txtboxPosBiayaSearch");
        Textbox txtboxNamaTableItemPosBiaya = (Textbox) w.getFellow("txtboxNamaTableItemPosBiaya");

        Textbox txtboxNamaTableSubItemPosBiaya = (Textbox) w.getFellow("txtboxNamaTableSubItemPosBiaya");
        Map m = (Map) lstboxPosBiaya.getSelectedItem().getValue();

        txtboxNamaTableItemPosBiaya.setValue(ClassAntiNull.AntiNullString(m.get("namaTabelItem")));
        txtboxNamaTableSubItemPosBiaya.setValue(ClassAntiNull.AntiNullString(m.get("namaTabelSubItem")));
        txtboxIdPosBiaya.setValue(ClassAntiNull.AntiNullInt(m.get("kodePosBiaya")) + "");
        lblPosBiaya.setValue(ClassAntiNull.AntiNullString(m.get("namaPosBiaya")));
        txtboxPosBiayaSearchP.setValue(ClassAntiNull.AntiNullString(m.get("namaPosBiaya")));
        this.detach();
    }
}
